<!--
* description: 整车销售--计划提报---是否紧急发送
* author:xlc
* createdDate: 2021-07-13
-->
<template>
  <div class="">
    <el-dialog
      v-dialogDrag
      :visible="popupsVisible"
      :title="titleName"
      center
      width="40%"
      :append-to-body="true"
      :close-on-click-modal="false"
      @close="closeEdit"
    >
      <dialogHeader slot="title" :title="titleName" :style-type="$store.state.app.dialogType" />
      <div
        v-loading="loading"
        style="padding-bottom:30px"
      >
        <el-row>
          <el-col :span="10" :offset="4">
            <el-button type="danger" @click="save('1')">紧急订单插单</el-button>
          </el-col>
          <el-col :span="10">
            <el-button type="primary" @click="save('0')">普通销售计划</el-button>
          </el-col>
        </el-row>
      </div>
    </el-dialog>
  </div>
</template>
<script>
// import { orgApis } from '@/api/vesalesapi.js'
import dialogHeader from '@/components/dialogHeader'
import Vue from 'vue'
export default {
  components: {
    dialogHeader
  },
  // 阻塞路由预加载网格中组件的数据
  beforeRouteEnter(to, from, next) {
    Vue.prototype.$ConfigCache.CacheConfig.initData([to.path, 'supplierMessage-edit'], () => {
      next()
    })
  },
  props: {
    popupsVisible: {
      type: Boolean,
      default: false
    },
    dataForForm: {
      type: Object,
      default: () => {}
    },
    titleName: {
      type: String,
      default: '是否紧急插单'
    }
  },
  data() {
    // 页面标识（与上面beforeRouteEnter中的对应）
    const viewPageCode = this.$route.path
    // 绑定事件配置化事件
    this.$ConfigCache.CacheConfig.bindEvent(this, [viewPageCode])
    return {
      loading: false
    }
  },
  methods: {
    // 关闭弹窗
    closeEdit(type) {
      this.$emit('close', type)
    },
    // 保存
    save(type) {
      this.$emit('sendsave', type)
    }
  }
}
</script>
